package designer.factory.simpleFactory;

import designer.factory.AndroidProgrammer;
import designer.factory.JavaProgrammer;
import designer.factory.PhpProgrammer;
import designer.factory.demoInterface.IProgrammer;

/**
 * 简单工厂模式
 * Created by tanlee on 2016/4/11.
 */
public class ProgrammerFactory {

    public IProgrammer createProgrammer(String language){
        IProgrammer IProgrammer = null;
        if(language.equals("JAVA")){
            IProgrammer = new JavaProgrammer();
        }
        else if(language.equals("ANDROID")){
            IProgrammer = new AndroidProgrammer();
        }
        else if(language.equals("PHP")){
            IProgrammer = new PhpProgrammer();
        }
        return IProgrammer;
    }
}
